package com.dsp.dao.impl;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import com.core.util.GenericDAOHibernate; 
import com.dsp.bean.User;
import com.dsp.dao.UserDAO;

public class UserDAOImpl extends GenericDAOHibernate<User, Long> implements
		UserDAO {
	public UserDAOImpl(Class<User> clazz){
		super(clazz);
	}
	
	public UserDAOImpl(){}

	@SuppressWarnings("unchecked")
	@Override
	public List<User> likeBy(final DetachedCriteria dc ) {
		return getHibernateTemplate().findByCriteria(dc, 1, 2);
		/**
		return (List<User>) getHibernateTemplate().execute(new HibernateCallback() {
			@Override
			public List doInHibernate(Session arg0) throws HibernateException, SQLException {
				Criteria criteria = dc.getExecutableCriteria(arg0);
				return  criteria.list();
			}
		}); **/
	}
}
